﻿namespace NTLib.Core.UTest.Configuration.DataSample
{
    using Core.Configuration;
    using Core.Configuration.Values;
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// This configuration class will just use the context pass ass configuration collection
    /// to easy the unit test
    /// </summary>
    /// <seealso cref="NTLib.Core.Configuration.IConfigurationProvider" />
    class TestConfigurationProvider : IConfigurationProvider
    {
        public const string TestKey = "TestConfigurationProvider";

        public ConfigurationCollection CollectConfigurationValue(Type host, object context = null, CancellationToken token = default(CancellationToken))
        {
            var collection = context as ConfigurationCollection;
            collection.Add(new StringConfig(TestKey, "added"));

            return collection;
        }
    }
}
